<!DOCTYPE html>
<html lang="zh-CN">
{%  load staticfiles %}
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="applicable-device" content="pc,mobile">
    <!-- Bootstrap core CSS -->
    <link href="https://img.jigao616.com/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://img.jigao616.com/css/style.css" rel="stylesheet">
     <link href="/static/css/common/common.css" rel="stylesheet">

    <script type="text/javascript" src="/static/script/map/jquery.min.js"></script>
    <script type="text/javascript" src="/static/script/map/echarts.min.js"></script>
    <script type="text/javascript" src="/static/script/map/china.js"></script>

    <!-- Stylesheet -->
    <link rel="stylesheet" href="http://www.rpcomputationalbiology.cn/static/style.css">
    <link rel="stylesheet" href="http://www.rpcomputationalbiology.cn/static/css/button.css">
    <title>预测</title>

    <!--JQUERY -->
    <!--模版的方式渲染本地的jquery。这里也可以去渲染服务 -->
    <script type="text/javascript" src="/static/script/map/echarts.min.js"></script>
    <script src="{% static 'script/common/jquery-3.1.1.min.js' %}"></script>
    <script src="https://img.jigao616.com/js/html5shiv.min.js"></script>
    <script src="/static/script/common/common.js"></script>
    <script src="/static/script/index/index.js"></script>
</head>
<body>
<header class="header-area">
    <!-- Top Header Area -->
    <div class="top-header-area d-flex justify-content-between align-items-center">
    </div>
    <!-- Navbar Area -->
    <div id="sticky-wrapper" class="sticky-wrapper is-sticky" style="height: 80px;">
        <div class="clever-main-menu" style="width: 100%; position: fixed; top: 0px; z-index: inherit;">
        <div class="classy-nav-container light left breakpoint-off">
            <!-- Menu -->
            <nav class="classy-navbar justify-content-between" id="cleverNav">

                <!-- Logo -->
                <a class="nav-brand" href="/index"><img src="{% static 'image/logo4.png' %}" alt="" style="width:550px;height:80px;margin-right:15px"></a>

                <!-- Navbar Toggler -->
                <div class="classy-navbar-toggler">
                    <span class="navbarToggler"><span></span><span></span><span></span></span>
                </div>

                <!-- Menu -->
                <div class="classy-menu">

                    <!-- Close Button -->
                    <div class="classycloseIcon">
                        <div class="cross-wrap"><span class="top"></span><span class="bottom"></span></div>
                    </div>

                    <!-- Nav Start -->
                    <div class="classynav">
                        <ul>
                           <li><a href="/index">主页</a></li>
                            <li ><a href="/visual">例子</a>
                            <li ><a href="/mysystem">预测</a>
                            <li><a href="/incidence">发病情况</a></li>
                            <li><a href="/inform/inform">研究现状</a></li>
                            <li><a href="/upfile">上传</a></li>
                        </ul>

<!--                        &lt;!&ndash; Search Button &ndash;&gt;-->
<!--                        <div class="register-login-area">-->
<!--                            <a href="/analysis" class="btn active">Run TPP</a>-->
<!--                        </div>-->

                        <!-- Register / Login -->
<!--                        <div class="register-login-area">-->
<!--                            <a href="/user/register" class="btn">注册</a>-->
<!--                            <a href="/user/login" class="btn">登录</a>-->
<!--                        </div>-->

                    </div>
                    <!-- Nav End -->
                </div>
            </nav>
        </div>
    </div></div>
</header>

<section class="popular-courses-area section-padding-100">
    <div class="container">
        <div class="row">
            <!-- Single Popular Course -->
            <div class="col-12 col-md-12 col-lg-12">
                <h4 class="mb-30"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">分析预测</font></font></h4>
                <!-- Nav tabs -->
                <div>

                    <!-- tab标签 -->
<!--                    <ul id="myTab" class="nav nav-tabs nav-justified">-->
<!--                        <li class="nav-item">-->
<!--                            <a class="nav-link active" href="#ppi" data-toggle="tab"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">-->
<!--                                KNN-->
<!--                            </font></font></a>-->
<!--                        </li>-->
<!--                        <li class="nav-item">-->
<!--                            <a class="nav-link" href="#custom" data-toggle="tab"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">-->
<!--                                PCA+HC-->
<!--                            </font></font></a>-->
<!--                        </li>-->
<!--                    </ul>-->
                    <div>
                        <select id="sel">
                            <option value="KNN">KNN</option>
                            <option value="PCA+HC">PCA+HC</option>
                            <option value="CNN">CNN</option>
                            <option value="RNN">RNN</option>
                        </select>
                    </div>
                    <hr/>
                     <button id="btn" class="btn btn-primary" data-toggle="modal" data-target="#modalUpdate1">
                       提交
                     </button>
                    <hr/>
                    <!-- Tab panes -->
                    <div id="myTabContent" class="tab-content">

                        <div class="tab-pane active" id="ppi">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="card">

                                        <div class="card-action">
                                            <!-- <button class="btn btn-success" onclick="submit()">Submit</button> -->

                                        </div>
                                       <div class="card-body ">
                                           <div id="res"></div>





                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<div class="footer">
            <p>
                <a href="javascript:void(0)">关于我们</a>
                <span class="line">|</span>
                <a href="javascript:void(0)">联系我们</a>
                <span class="line"></span>
            </p>
            <p>Copyright © 2018 All Rights Reserved. </p>
            <p> <a href="javascript:void(0)" target="_blank" rel="nofollow">XICP备xxxxx号-x</a>公网安备 xxxxxxxxxx号 归xxx所有</p>
         </div>
</body>

<script>

    var btn2 = document.getElementById('btn');
    btn2.addEventListener('click', sub, false);
    function sub(){
    document.getElementById('res').innerHTML="预测中，请稍等。。。";
    var v1 = $("#sel").val();
<!--    alert(v1)-->
    url1=''
    if(v1=='KNN'){
        $.ajax({
                url: {% url 'get_knnpre_data' %},
<!--                async: false,-->
                type: "POST",
                data: {},
                success: function (data) {
                    document.getElementById('res').innerHTML="该地风险等级为："+data;
                }
           })
           }
    if(v1=='PCA+HC'){
        $.ajax({
                url: {% url 'get_pcapre_data' %},
<!--                async: false,-->
                type: "POST",
                data: {},
                success: function (data) {
                    document.getElementById('res').innerHTML="该地预计人数为："+data;
                }
    })
    }
    if(v1=='CNN') {
        $.ajax({
                url: {% url 'get_cnn_data' %},
<!--                async: false,-->
                type: "POST",
                data: {},
                success: function (data) {
                    document.getElementById('res').innerHTML="该地风险等级为："+data;
                }
    })
    }
    if(v1=='RNN')
    {           $.ajax({
                url: {% url 'get_rnn_data' %},
<!--                async: false,-->
                type: "POST",
                data: {},
                success: function (data) {
                    document.getElementById('res').innerHTML="该地风险等级为："+data;
                }
    })
    }
    }


</script>

</html>